import React, { Component } from 'react';
import { message } from 'antd';
import { router } from 'umi';
import ProDetail from '@/pages/components/Problem/ProblemPage/ProDetail';

class Proble extends Component {
  onModifyData = data => {
    switch (data.adjType) {
      case 1:
        router.push(
          `/customservicemanage/adjusttask/insupdate?adjId=${data.busiId}&custId=${
            data.custId
          }&sendId=${data.sendId}`
        );
        break;
      case 2:
        router.push(
          `/customservicemanage/adjusttask/accuupdate?adjId=${data.busiId}&custId=${
            data.custId
          }&sendId=${data.sendId}`
        );
        break;
      default:
        message.warning('努力开发中。。。');
        break;
    }
  };

  onViewDetails = data => {
    router.push(
      `/customservicemanage/adjusttask/${
        data.adjType === 3 ? 'persondetail' : 'detail'
      }?adjTaskId=${data.busiId}&adjType=${data.adjType}`
    );
  };

  render() {
    return <ProDetail onModifyData={this.onModifyData} onViewDetails={this.onViewDetails} />;
  }
}

export default Proble;
